
class LoginUser {
  LoginUser({
    String? id,
    String? username,
    String? nickname,
    String? headImgUrl,
    String? mobile,
    String? gwsdId,
    String? idcard,
    String? gwsdUsername,
    String? gwsdPassword,
    String? dataCode
  }) {
    _id = id;
    _username = username;
    _nickname = nickname;
    _headImgUrl = headImgUrl;
    _mobile = mobile;
    _idcard = idcard;
    _dataCode = dataCode;
  }

  LoginUser.fromJson(dynamic json) {
    _id = json['id'];
    _username = json['username'];
    _nickname = json['nickname'];
    _headImgUrl = json['headImgUrl'];
    _mobile = json['mobile'];
    _gwsdId = json['gwsdId'];
    _gwsdUsername = json['gwsdUsername'];
    _gwsdPassword = json['gwsdPassword'];
    _idcard = json['idcard'];
    _dataCode = json['dataCode'];
  }

  String? _id;
  String? _username;
  String? _idcard;
  String? _nickname;
  String? _headImgUrl;
  String? _mobile;
  String? _gwsdId;
  String? _gwsdUsername;
  String? _gwsdPassword;
  String? _dataCode;

  LoginUser copyWith({
    String? id,
    String? username,
    String? nickname,
    String? headImgUrl,
    String? mobile,

  }) =>
      LoginUser(
        id: id ?? _id,
        username: username ?? _username,
        nickname: nickname ?? _nickname,
        headImgUrl: headImgUrl ?? _headImgUrl,
        mobile: mobile ?? _mobile,
        gwsdId: _gwsdId,
        gwsdUsername: _gwsdUsername,
        gwsdPassword: _gwsdPassword,
        idcard: _idcard,
      );

  String? get id => _id;

  String? get username => _username;

  String? get nickname => _nickname;

  String? get headImgUrl => _headImgUrl;

  String? get mobile => _mobile;
  String? get gwsdId => _gwsdId;
  String? get gwsdUsername => _gwsdUsername;
  String? get gwsdPassword => _gwsdPassword;
  String? get idcard => _idcard;
  String? get dataCode => _dataCode;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['username'] = _username;
    map['nickname'] = _nickname;
    map['headImgUrl'] = _headImgUrl;
    map['mobile'] = _mobile;
    map['gwsdId'] = _gwsdId;
    map['gwsdUsername'] = _gwsdUsername;
    map['gwsdPassword'] = _gwsdPassword;
    map['idcard'] = _idcard;
    map['dataCode'] = _dataCode;
    return map;
  }
}

// 登录返回
class UserLoginResponseEntity {
  String? accessToken;

  UserLoginResponseEntity({
    this.accessToken,
  });

  factory UserLoginResponseEntity.fromJson(Map<String, dynamic> json) =>
      UserLoginResponseEntity(
        accessToken: json["access_token"],
      );

  Map<String, dynamic> toJson() => {
        "access_token": accessToken,
      };
}
